import { useState, useEffect } from "react"
import { Button } from "antd"
function Demo42({ getName }) {
    const [name, setName] = useState("王二麻子")
    return (
        <div className="main_box">
            <div>
                子组件2
                <Button type="primary" onClick={() => getName(name)}>
                    传值给父组件
                </Button>
            </div>
        </div>
    )
}

export default Demo42
